package org.de.maeyer.sampler;

/**
 * @author Peter De Maeyer
 */
public interface ObjectSampler extends Sampler {
	
	void sample(Object value);
	
	ObjectSampler accumulateCount();
	
	ObjectSampler accumulateElapsedTime();
	
	ObjectSampler accumulateRate();
	
	ObjectSampler accumulateLastValue();
	
	/**
	 * Installs an accumulator for an unbounded histogram. An unbounded histogram will create a new category every time a value is sampled that did not match any value sampled so far. It will thus <i>never</i> create a category "Other". Beware of memory consumption when using this method! 
	 */
	ObjectSampler accumulateHistogram();
	
	/**
	 * Installs an accumulator for a histogram, bound by a predefined set of values. If a value is sampled that does not match any of the predefined category values, an additional category "Other" will automatically be created.
	 */
	ObjectSampler accumulateHistogram(Object... categoryValues);

	/**
	 * Installs a bounded accumulator for a histogram, bound but with an undefined set of values. If the category bound is reached and a value is sampled that does not match any of the values sampled so far, an additional category "Other" will automatically be created.
	 */
	ObjectSampler accumulateHistogram(int categoryBound);
}
